<!-- /* Description for file.
 * 当前员工信息
 * @copyright     Copyright 2008-2010, PHInfo Services Inc. (http://www.phinfoservices.com)
 * @package       ues
 * @subpackage    ues/app/views/users
 * @since         ues
 * @version       V0.0.1
 * @modifiedby    张海杰2011年0628
 * @lastmodified  张海杰2011年0705
 */
 -->

<?php
echo $html->css ( 'tab' );
echo $html->css ( 'style' );
echo $javascript->link('jquery-1.4.2');
echo $html->css('start/jquery-ui-1.8.2.custom');
echo $javascript->link('jquery-ui-1.8.2.custom.min');
echo $html->css ( 'jquery-validate/css/screen' );
echo $javascript->link ( 'jquery-validate/jquery.validate');
echo $javascript->link ( 'jquery-validate/additional-methods');
echo $javascript->link ( 'jquery-validate/localization/messages_cn');

?>

<script type="text/javascript">
//添加验证
$(document).ready(function() {
	$.validator.setDefaults({       
		 submitHandler: function(form) {    
		  form.submit();    
		}       
	});   
			
	$("#usereditform").validate({
		rules: {
		"data[User][birthday]"  :{
			required: false,dateISO:true,endDate:"1950-01-01"
			},//
			"data[User][password]"  :{
				required: true,password:true,stringMinLength:3,stringMaxLength:20
				},//
				"data[User][tel]"  :{
					required: false,phone:true
					},//
					"data[User][email]"  :{
						required: false,email:true
						},//
						"data[User][mobilePhone]"  :{
							required: false,mobile:true
							},//
							"data[User][otherMessage]"  :{
								required: false
								} 
		},
		messages:{		"data[User][birthday]"  :{
			endDate:"请输入大于1950-01-01的生日日期！"}
		},
		focusInvalid:false,
		onkeyup:false,
		errorPlacement:function(error, element){error.appendTo(element.parent());}
	});
});
//验证结束

$(function(){
	$(".datepickerSpan :input").datepicker({
		inline: true
	});
	 $('.datepickerSpan :input').datepicker('option', {dateFormat: "yy-mm-dd"});
	 $('.datepickerSpan :input').datepicker( "option", "closeText", 'X' );
});
</script>


<script type="text/javascript">
	function mycheck() {
		$("#usereditform").submit();	
	}		
</script>

<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php echo __('Personal Office');//一级目录
										   echo '>';?>
									<?php echo $html->tag('span', __('当前用户信息',true));//当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<!-- 当前位置-->
<?php echo $form->create('User',array('action'=>'edit/'.$user['User']['id'],'type'=> 'post','id'=>'usereditform'));?>
<?php echo $form->hidden('id',array('default'=>$user['User']['id']));?>
<?php echo $form->hidden('group_id',array('default'=>$user['Group']['id']));?>
<?php echo $form->hidden('department_id',array('default'=>$user['Department']['id']));?>
<div class="tabflex">
<fieldset><legend><?php __('User Information');?></legend>
<table width="100%" cellspacing="0" cellpadding="0" border="0"
	style="text-align: left">
	<tr>
		<td width="5%"></td>
		<td width="10%"><?php __('userGroup');?>&nbsp;<span><font color=red >*</font></span></td>
		<?php $option1=array($user['Organ']['id']=>$user['Organ']['name']); ?>
		<td  width="30%"><?php echo $form->input('organ_id',array('options'=>$option1,'default' =>$user['Organ']['name'],'class' => 'TextBoxE2','div'=>false,'label'=>false,'disabled'=>true));?></td>
		<td width="5%"></td>
		<td width="10%"><?php __('userDepartment');?>&nbsp;<span><font color=red >*</font></span></td>
		<?php $option2=array($user['Department']['id']=>$user['Department']['name']); ?>
		<td   width="40%"><?php echo $form->input('department_id',array('options'=>$option2,'default' =>$user['Department']['name'],'class' => 'TextBoxE2','div'=>false,'label'=>false,'disabled'=>true));?></td>
		<td></td>
	</tr>
	<tr>
	<td></td>
	<td><?php __('User');?>&nbsp;<span><font color=red >*</font></span></td>
	<td><?php echo $form->input('username',array('default'=>$user['User']['username'],'class' => 'TextBoxE2','div'=>false,'label'=>false,'disabled'=>true));?></td>
	<td></td>
	<td><?php __('userbirthday');?></td>
	<td>
	<!-- <span class="datepickerSpan"> -->
	<?php //echo $form->input('birthday',array('default'=>$user['User']['birthday'],'class' => 'TextBoxE2','label'=>false));?>
	<!-- </span>-->
		<?php		echo $form->input('birthday',array('type'=>'date','minYear'=>'1950','maxYear'=>'2010','dateFormat'=>'YMD','monthNames' => false,'selected'=> $user['User']['birthday'],'empty'=>'不填','label'=>false));
			?></td>
	<td></td>
	</tr>
	<tr>
	<td></td>
	<td><?php __('userpassword');?>&nbsp;<span><font color=red >*</font></span></td>
	<td><?php echo $form->input('password',array('class' => 'TextBoxE2','div'=>false,'label'=>false));?></td>
	<td></td>
	<td><?php __('usersex');?></td>
	<?php 
	 $option3=array(""=>"保密","1"=>"男","0"=>"女");
	?>
	<td ><?php echo $form->input('sex',array('options'=>$option3,'default' =>$user['User']['sex'],'div'=>false,'label'=>false));?></td>
	<td></td>
	</tr>
	<tr>
	<td></td>
	<td><?php __('xm');?>&nbsp;<span><font color=red >*</font></span></td>
	<td ><?php echo $form->input('name',array('default'=>$user['User']['name'],'class' => 'TextBoxE2','div'=>false,'label'=>false,'disabled'=>true));?></td>
	<td></td>
	<td ><?php __('usertel');?></td>
	<td><?php echo $form->input('tel',array('default'=>$user['User']['tel'],'class' => 'TextBoxE2','label'=>false));?></td>
	<td></td>
	</tr>
	<tr>
	<td ></td>
	<td ><?php __('useremail');?></td>
	<td ><?php echo $form->input('email',array('default'=>$user['User']['email'],'class' => 'TextBoxE2','label'=>false));?></td>
	<td></td>
	<td><?php __('userMobile');?></td>
	<td><?php echo $form->input('mobilePhone',array('default'=>$user['User']['mobilePhone'],'class' => 'TextBoxE2','label'=>false));?></td>
	<td></td>
	</tr>
	<tr>
	<td></td>
	<td style="vertical-align:top;"><?php __('otherMessage');?>：</td>
	<td colspan="6"><?php echo $form->textarea('otherMessage',array('default'=>$user['User']['otherMessage'],'class' => 'TextArea txtOut','label'=>false));?></td>
	</tr>
</table>
<!--<div class="actions"  id="notices-actions" style="float:left;margin-left:120px;">

	<ul>
		<li>
			<a><?php echo $html->image('edit.gif', array('alt' =>  __('Edit', true),'border'=>'0','onclick'=>'mycheck()'));?></a>
 					  __('Add', true) 增加 
		</li>
		 
		<li >
			<a><?php echo $html->image('delete.gif', array('alt' =>  __('Delete', true),'border'=>'0','onclick'=>'getDelStr()'));?></a>
				
		</li>
		
		<li>
			<?php echo $form->button('重置',array('type'=>'reset','class'=>'resetsubmit'));?>

 					  __('Add', true) 增加 
		</li>
		

	</ul>
</div>
--></fieldset>
	<table width="100%" cellspacing="0" cellpadding="0" border="0" style="text-align: left">
	<tr>
		<td width="50"></td>
		<td width="100"><?php echo $form->button('确定',array('type'=>'button','class'=>'oksubmit','onclick'=>'mycheck()'));?>
		<td width="100"><?php echo $form->button('重置',array('type'=>'reset','class'=>'resetsubmit'));?>
		</td>
	</tr>
	</table>
</div>	
<?php echo $form->end();?>

